package com.inossem.allotin.db.greendao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.inossem.allotin.db.AllotInBean;
import com.inossem.allotin.db.CacheBean;

import com.inossem.allotin.db.greendao.AllotInBeanDao;
import com.inossem.allotin.db.greendao.CacheBeanDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig allotInBeanDaoConfig;
    private final DaoConfig cacheBeanDaoConfig;

    private final AllotInBeanDao allotInBeanDao;
    private final CacheBeanDao cacheBeanDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        allotInBeanDaoConfig = daoConfigMap.get(AllotInBeanDao.class).clone();
        allotInBeanDaoConfig.initIdentityScope(type);

        cacheBeanDaoConfig = daoConfigMap.get(CacheBeanDao.class).clone();
        cacheBeanDaoConfig.initIdentityScope(type);

        allotInBeanDao = new AllotInBeanDao(allotInBeanDaoConfig, this);
        cacheBeanDao = new CacheBeanDao(cacheBeanDaoConfig, this);

        registerDao(AllotInBean.class, allotInBeanDao);
        registerDao(CacheBean.class, cacheBeanDao);
    }
    
    public void clear() {
        allotInBeanDaoConfig.clearIdentityScope();
        cacheBeanDaoConfig.clearIdentityScope();
    }

    public AllotInBeanDao getAllotInBeanDao() {
        return allotInBeanDao;
    }

    public CacheBeanDao getCacheBeanDao() {
        return cacheBeanDao;
    }

}
